package cn.lisens.async.web;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fasterxml.jackson.annotation.JsonView;

import cn.lisens.demo.entity.Role;
import cn.lisens.demo.entity.User;

@RestController
public class JacksonController {

	
	@RequestMapping("user")
	@JsonView(User.WithoutPasswordView.class)
	public User get() {
		return new User("zhangsan","fafdaf!!@@$3");
	}
	
	@RequestMapping("list")
	@JsonView(User.WithoutPasswordView.class)
	public Role list() {
		User user = new User("zhangsan","fafdaf!!@@$3");
		Role role = new Role();
		role.setRoleCode("role1");
		role.getList().add(user);
		return role;
	}
}
